package br.ufmg.ubicomp.droidguide.service;

import java.util.Collections;
import java.util.Map;

public abstract class DGServerService {

	protected Map<String, Object> params;

	public void addParameter(String key, Object value) {
		params.put(key, value);
	}

	public void addParameters(Map params)
	{
		for (Object key: params.keySet())
		{
			this.params.put(key.toString(), params.get(key));
		}
	}
	
	public void removeParameter(String key) {
		params.remove(key);
	}

	public Object getParameter(String key) {
		return params.get(key);
	}

	/**
	 * returns the parameters of the service.
	 * @return the parameters
	 */
	public Map<String, Object> getParams() {
		return Collections.unmodifiableMap(params);
	}

	/**
	 * the service shoudl execute something
	 */
	public abstract boolean execute();
	
}
